/*
 * avm.h
 *
 *  Created on: 2009-11-30
 *      Author: Bearice
 */

#ifndef AVM_H_
#define AVM_H_

#ifndef NULL
#define NULL 0
#endif
#ifdef WIN32
#if defined(AVM_CORE) || defined(AVM_LIB)
#define AVM_API __declspec(dllexport)
#else
#define AVM_API __declspec(dllimport)
#endif
#else
#define AVM_API extern
#endif
#define DEBUG printf
typedef long long int64;
typedef unsigned long long uint64;
typedef long int32;
typedef unsigned long uint32;
typedef short int16;
typedef unsigned short uint16;
typedef char int8;
typedef unsigned char uint8;
enum {
	ORZ_MAGIC = 0x4F727AF0,
	ORZ_VERSION = (((2) << 8) & 0xFF00) | (1 & 0x00FF),
	TAG_CONSTANT = 1,
	TAG_CODE = 2,
	TAG_STRING = 3,
	TAG_INTEGER = 4,
	TAG_DOUBLE = 5,
	TAG_IDENTIFIER = 6,
	TAG_CLOSERTABLE = 7,
	TAG_LINE_NUMBER_TABLE = 8,
	TAG_PAIR = 9,
	TAG_FUNCTION = 10,
	TAG_CLOSURE_REF = 11,

	TRUE = -1,
	FALSE = 0,

	BYTE_IF = 1,
	BYTE_LAMBDA = 4,
	BYTE_LIST = 6,
	BYTE_CALL = 7,
	BYTE_NOP = 8,
	BYTE_PUSHD = 9,
	BYTE_POPD = 10,
	BYTE_JZ = 11,
	BYTE_JNZ = 12,
	BYTE_JMP = 13,
	BYTE_PLUS = 14,
	BYTE_MINUS = 15,
	BYTE_MULTIPLY = 16,
	BYTE_DIVIDE = 17,
	BYTE_EQ = 18,
	BYTE_NE = 19,
	BYTE_LT = 20,
	BYTE_LE = 21,
	BYTE_GT = 22,
	BYTE_GE = 23,
	BYTE_AND = 24,
	BYTE_OR = 25,
	BYTE_XOR = 26,
	BYTE_CONS = 27,
	BYTE_CAR = 28,
	BYTE_CDR = 29,
	BYTE_IS_PAIR = 30,
	BYTE_IS_NULL = 31,
	BYTE_GETS = 32,
	BYTE_PUTS = 33,
	BYTE_LOAD = 34,
	BYTE_STORE = 35,
	BYTE_NEG = 36,
	BYTE_PUSH = 37,
	BYTE_POP = 38,
	BYTE_LDC = 39,
	BYTE_RET = 40,
	BYTE_REM = 41,
	BYTE_NOT = 42,
};
const char* CODE_NAME[];
#include <vm_exec.h>
#endif /* AVM_H_ */
